package com.book.inteliget.forBook;

import java.util.Collection;

import com.book.inteliget.constants.Constants;
import com.book.inteliget.forBook.collectionBook.Author;
import com.book.inteliget.forBook.collectionBook.Reviews;

import thewebsemantic.Namespace;
import thewebsemantic.RdfProperty;
import thewebsemantic.RdfType;


@Namespace(Constants.SCHEMA)
@RdfType("Book")
public class Book {
	
	@RdfProperty(Constants.SCHEMA + "name")
	private String name;
	
	@RdfProperty(Constants.SCHEMA + "bookFormat")
	private String bookFormatType;
	
	@RdfProperty(Constants.SCHEMA + "numberOfPages")
	private int numberOfPages;
	
	@RdfProperty(Constants.SCHEMA + "isbn")
	private String isbn;
	
	@RdfProperty(Constants.SCHEMA + "inLanguage")
	private String inLanguage;
	
	@RdfProperty(Constants.SCHEMA + "awards")
	private String awards;
	
	
	@RdfProperty(Constants.SCHEMA + "author")
	private Collection<Author> authors;
	
	@RdfProperty(Constants.SCHEMA + "reviews")
	private Collection<Reviews> reviews;

	@Override
	public String toString() {
		return "Book [name=" + name + ", bookFormatType=" + bookFormatType
				+ ", numberOfPages=" + numberOfPages + ", isbn=" + isbn
				+ ", inLanguage=" + inLanguage + ", awards=" + awards
				+ ", authors=" + authors + ", reviews=" + reviews + "]";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getBookFormatType() {
		return bookFormatType;
	}

	public void setBookFormatType(String bookFormatType) {
		this.bookFormatType = bookFormatType;
	}

	public int getNumberOfPages() {
		return numberOfPages;
	}

	public void setNumberOfPages(String numberOfPages) {
		String [] a = numberOfPages.split(" ");
		this.numberOfPages = Integer.parseInt(a[1]);
	}

	public String getIsbn() {
		return isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public String getInLanguage() {
		return inLanguage;
	}

	public void setInLanguage(String inLanguage) {
		this.inLanguage = inLanguage;
	}

	public String getAwards() {
		return awards;
	}

	public void setAwards(String awards) {
		this.awards = awards;
	}

	public Collection<Author> getAuthors() {
		return authors;
	}

	public void setAuthors(Collection<Author> authors) {
		this.authors = authors;
	}

	public Collection<Reviews> getReviews() {
		return reviews;
	}

	public void setReviews(Collection<Reviews> reviews) {
		this.reviews = reviews;
	}
	
}
